import "@/styles/globals.css";
import "@/styles/article.scss";
import React from "react";
import { ConfigProvider } from "antd";
import type { AppProps } from "next/app";
import zhCN from "antd/locale/zh_CN";
import MainLayout from "@/components/MainLayout";

const App = ({ Component, pageProps }: AppProps) => {
  const getLayout =
    Reflect.get(Component, "customLayout") ||
    ((page: any) => <MainLayout>{page}</MainLayout>);

  return (
    <ConfigProvider locale={zhCN}>
      {getLayout(<Component {...pageProps} />)}
    </ConfigProvider>
  );
};

export default App;
